package com.fastloan.mgt.application.contract.service.impl.loanmode.mode.ry.enmus;

/**
 * 融钰订单状态
 *
 * @author yanwe
 * createTime 2018-01-2018/1/15 21:09
 */
public enum RyApplicationStatus {

    WAIT_AUDIT("1","待审核"),
    AUDIT_REJECT("2","审核拒绝"),
    WAIT_LOAN("3","待放款"),
    LOAN_ING("4","打款处理中"),
    WAIT_REPAYMENT("5","还款中(打款成功)"),
    LOAN_FAIL("6","打款失败"),
    ADVANCE_REPAYMENT_FINISH("7","提前还清"),
    FINISH("8","全部还清"),
    OVERDUE("9","逾期中");

    private String status;

    private String statusName;

    RyApplicationStatus(String status, String statusName) {
        this.status = status;
        this.statusName = statusName;
    }

    public String getStatus() {
        return status;
    }

    public String getStatusName() {
        return statusName;
    }

    public static RyApplicationStatus getByStatus(String status){
        switch (status){
            case "1" :
                return WAIT_AUDIT;
            case "2" :
                return AUDIT_REJECT;
            case "3" :
                return WAIT_LOAN;
            case "4" :
                return LOAN_ING;
            case "5" :
                return WAIT_REPAYMENT;
            case "6" :
                return LOAN_FAIL;
            case "7" :
                return ADVANCE_REPAYMENT_FINISH;
            case "8" :
                return FINISH;
            case "9" :
                return OVERDUE;
            default:
                throw new IllegalArgumentException("未知的融钰订单状态:"+status);
        }
    }
}
